from __future__ import with_statement
import sys
sys.path.append("/home/stefan/Documents/fydp/fydp-david/module-test/fydp-david/src")
import gdb
import audio_start_range
import pyata_module


class StartAudioRangeCommand (gdb.Command):

    def __init__ (self):
        super (StartAudioRangeCommand, self).__init__ ("audio startrng",
                                                       gdb.COMMAND_SUPPORT,
                                                       gdb.COMPLETE_FILENAME)

    def invoke (self, arg, from_tty):		
		print "Starting audio range at " + str(arg)
		pitch = input('Enter the pitch: ')
		volume = input('Enter the volume: ')
		bp = AudioStartRange(arg)
		bp.pitch = pitch
		bp.volume = volume
		pyata_module.setLastRangeStart(bp.number)
		print "audio range starting at"
		print arg
	

StartAudioRangeCommand ()
